Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow RpmNameGlob for versionlock entries #335

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

kBite
Copy link

@kBite kBite commented Aug 22, 2024

Rebased @foxxx0 commit against master (see #228)

We're using his feature branch internally with RHEL 8 and RHEL 9 for about 2 years.


As stated in the manpage [1] yum versionlock supports package-wildcard
and does not require exact matches for package-names.
The following is valid versionlock.list content:

libvirt*-0:7.6.0-*.*
qemu*-0:6.1.0-*.*

This commit swaps Yum::RpmName with Yum::RpmNameGlob for the
versionlock assert_type() and thus allowing the above mentioned
examples.

[1] https://man7.org/linux/man-pages/man1/yum-versionlock.1.html

As stated in the manpage [1] yum versionlock supports package-wildcard
and does not require exact matches for package-names.
The following is valid `versionlock.list` content:
```
libvirt*-0:7.6.0-*.*
qemu*-0:6.1.0-*.*
```

This commit swaps `Yum::RpmName` with `Yum::RpmNameGlob` for the
versionlock `assert_type()` and thus allowing the above mentioned
examples.

[1] https://man7.org/linux/man-pages/man1/yum-versionlock.1.html
@kBite kBite requested review from bastelfreak and vchepkov August 22, 2024 16:46
@bastelfreak bastelfreak added the enhancement New feature or request label Aug 22, 2024
@kBite
Copy link
Author

kBite commented Aug 22, 2024

Example:

~ # dnf --assumeno --disablerepo=* --enablerepo=percona_pdpxc-8.0 update
Last metadata expiration check: 0:04:29 ago on Thu 22 Aug 2024 04:52:38 PM UTC.
Dependencies resolved.
=============================================================================================================================================================
 Package                                                Architecture            Version                             Repository                          Size
=============================================================================================================================================================
Upgrading:
 percona-toolkit                                        x86_64                  3.5.5-1.el8                         percona_pdpxc-8.0                   22 M
 percona-xtrabackup-80                                  x86_64                  8.0.33-28.1.el8                     percona_pdpxc-8.0                   43 M
 percona-xtradb-cluster                                 x86_64                  8.0.33-25.1.el8                     percona_pdpxc-8.0                   31 k
 percona-xtradb-cluster-client                          x86_64                  8.0.33-25.1.el8                     percona_pdpxc-8.0                   15 M
 percona-xtradb-cluster-icu-data-files                  x86_64                  8.0.33-25.1.el8                     percona_pdpxc-8.0                  2.1 M
 percona-xtradb-cluster-server                          x86_64                  8.0.33-25.1.el8                     percona_pdpxc-8.0                  133 M
 percona-xtradb-cluster-shared                          x86_64                  8.0.33-25.1.el8                     percona_pdpxc-8.0                  1.5 M
 percona-xtradb-cluster-shared-compat                   x86_64                  8.0.33-25.1.el8                     percona_pdpxc-8.0                  1.1 M

Transaction Summary
=============================================================================================================================================================
Upgrade  8 Packages

Total download size: 217 M
Operation aborted.
~ # cat /etc/dnf/plugins/versionlock.list
# File managed by puppet
percona-xtradb-cluster*-0:8.0.32-24.2.el8.*
~ # dnf --assumeno --disablerepo=* --enablerepo=percona_pdpxc-8.0 update
Last metadata expiration check: 0:04:43 ago on Thu 22 Aug 2024 04:52:38 PM UTC.
Dependencies resolved.
=============================================================================================================================================================
 Package                                    Architecture                Version                                 Repository                              Size
=============================================================================================================================================================
Upgrading:
 percona-toolkit                            x86_64                      3.5.5-1.el8                             percona_pdpxc-8.0                       22 M
 percona-xtrabackup-80                      x86_64                      8.0.33-28.1.el8                         percona_pdpxc-8.0                       43 M

Transaction Summary
=============================================================================================================================================================
Upgrade  2 Packages

Total download size: 65 M
Operation aborted.

Copy link

@vchepkov vchepkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, you need to use --raw switch, otherwise dnf versionlock (totally different format) would require you to use NEVRA

https://dnf-plugins-core.readthedocs.io/en/latest/versionlock.html

PS. Since we edit file directly, it doesn't matter

@kBite
Copy link
Author

kBite commented Sep 23, 2024

@vchepkov Thanks a lot

@kBite kBite merged commit 75df7c0 into master Sep 23, 2024
14 of 15 checks passed
@kBite kBite deleted the allow_versionlock_glob-rebased branch September 23, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants